﻿using System;
using System.Runtime.InteropServices;

namespace Common
{
    [StructLayout(LayoutKind.Auto)]
    public struct ReferencePoolInfo
    {
        /// <summary>
        /// 获取引用池类型
        /// </summary>
        public Type Type => m_Type;

        /// <summary>
        /// 获取未使用的引用数量
        /// </summary>
        public int UnUsedReferenceCount => unUsedReferenceCount;

        /// <summary>
        /// 获取正在使用的引用数量
        /// </summary>
        public int UsingReferenceCount => usingReferenceCount;

        /// <summary>
        /// 获取获取引用数量
        /// </summary>
        public int AcquireReferenceCount => acquireReferenceCount;

        /// <summary>
        /// 获取释放引用数量
        /// </summary>
        public int ReleaseReferenceCount => releaseReferenceCount;

        /// <summary>
        /// 获取实例化引用数量
        /// </summary>
        public int AddReferenceCount => addReferenceCount;

        /// <summary>
        /// 获取移除引用数量
        /// </summary>
        public int RemoveReferenceCount => removeReferenceCount;

        private readonly Type m_Type;
        /// <summary>
        /// 未使用的引用数量
        /// </summary>
        private readonly int unUsedReferenceCount;
        /// <summary>
        /// 正在使用的引用数量
        /// </summary>
        private readonly int usingReferenceCount;
        /// <summary>
        /// 获取引用数量
        /// </summary>
        private readonly int acquireReferenceCount;
        /// <summary>
        /// 释放引用数量
        /// </summary>
        private readonly int releaseReferenceCount;
        /// <summary>
        /// 实例化引用数量
        /// </summary>
        private readonly int addReferenceCount;
        /// <summary>
        /// 移除引用数量
        /// </summary>
        private readonly int removeReferenceCount;
        
        
        public ReferencePoolInfo(Type type, int unUsedReferenceCount, int usingReferenceCount, int acquireReferenceCount, int releaseReferenceCount, int addReferenceCount, int removeReferenceCount)
        {
            this.m_Type = type;
            this.unUsedReferenceCount = unUsedReferenceCount;
            this.usingReferenceCount = usingReferenceCount;
            this.acquireReferenceCount = acquireReferenceCount;
            this.releaseReferenceCount = releaseReferenceCount;
            this.addReferenceCount = addReferenceCount;
            this.removeReferenceCount = removeReferenceCount;
        }
    }
}